package com.changfen.service.impl;

import com.changfen.dao.es.EsBaseDao;
import com.changfen.dao.es.EsKlineDao;
import com.changfen.service.BaseService;
import com.changfen.service.KlineService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.Optional;

/**
 * @author 86180
 * @Classname BaseServiceImpl
 * @Description TODO
 * @Date 2022/8/28 21:10
 */
public abstract class BaseServiceImpl<T,ID> implements BaseService<T,ID> {

    protected abstract EsBaseDao<T,ID> getEsBaseDao();

    @Override
    public <S extends T> S save(S entity) {
        return getEsBaseDao().save(entity);
    }

    @Override
    public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
        return getEsBaseDao().saveAll(entities);
    }

    @Override
    public Optional<T> findById(ID id) {
        return Optional.empty();
    }

    @Override
    public boolean existsById(ID id) {
        return false;
    }

    @Override
    public Iterable<T> findAll() {
        return null;
    }

    @Override
    public Iterable<T> findAllById(Iterable<ID> ids) {
        return null;
    }

    @Override
    public long count() {
        return 0;
    }

    @Override
    public void deleteById(ID id) {

    }

    @Override
    public void delete(T entity) {

    }

    @Override
    public void deleteAll(Iterable<? extends T> entities) {

    }

    @Override
    public void deleteAll() {

    }
}
